# coding=utf-8

"""
    Created by Kalyter on 2017-12-13.
"""


class JOBS(object):
    FILL_JOB = {
        'cls': 'learning.scientifc.jobs.fill_up_job.FillUpJob',
        'kwargs': {
            'gdp': False,
            'tariff': True,
            'other': False
        }
    }

    CRAWL_JOB = {
        'cls': 'learning.scientifc.jobs.crawl_job.CrawlJob'
    }

    COMPARE_JOB = {
        'cls': 'learning.scientifc.jobs.compare_job.CompareJob'
    }

    COMPUTE_AVERAGE_JOB = {
        'cls': 'learning.scientifc.jobs.compute_average_custom_job.CACJob'
    }

    SUM_JOB = {
        'cls': 'learning.scientifc.jobs.sum_job.SumJob'
    },

    SUB_CATEGORY_JOB = {
        'cls': 'learning.scientifc.jobs.judge_sub_category.JudgeSubCategory'
    }

    EXTRACT_NUMBERS_JOB = {
        'cls': 'learning.scientifc.jobs.extract_numbers.ExtractNumbersJob'
    }

    COUNT_WORDS_JOB = {
        'cls': 'learning.scientifc.jobs.count_words.CountWordsJob'
    }

    DUPLICATE_JOB = {
        'cls': 'learning.scientifc.jobs.DuplicateLineJob.DuplicateLineJob',
    }

    JOBS = [
        # FILL_JOB,
        # CRAWL_JOB,
        # COMPARE_JOB,
        # COMPUTE_AVERAGE_JOB,
        # SUM_JOB,
        # SUB_CATEGORY_JOB
        # EXTRACT_NUMBERS_JOB,
        # COUNT_WORDS_JOB,
        DUPLICATE_JOB
    ]


class DevConfig(object):
    """开发环境配置"""

    RESOURCES_PATH = r'D:\learning_resources'

    AVERAGE_PATH = r'D:\learning_resources\2018new\关税6'

    AVERAGE_CUT_LEN = 2

    AVERAGE_HEADER = 'HS%s' % AVERAGE_CUT_LEN

    AVERAGE_RATE = 'AdValorem'

    AVERAGE_REPORTER = 'ReporterName'

    AVERAGE_PARTNER = 'PartnerName'

    AVERAGE_RATE_NAME = 'MeasureName'

    AVERAGE_YEAR = 'Year'

    AVERAGE_CUSTOM_CODE = 'ProductCode'

    READER_TYPES = {
        'csv': 'learning.scientifc.readers.csv_reader.CSVReader',
        'xls': 'learning.scientifc.readers.xls_reader.XLSReader',
        'xlsx': 'learning.scientifc.readers.xls_reader.XLSReader'
    }

    HEAT_DATA_FILENAME = r'D:\learning_resources\2018new\china2.xlsx'

    COMPARE_PATH = r'D:\learning_resources\heat_data\AP'

    ######################################
    # 填充作业
    ######################################
    FILL_SOURCE = r'D:\learning_resources\2018new\stata-中国出口贸易数据-result.xls'

    FILL_GDP = r'D:\learning_resources\2018new\38个国家15年GDP数据.xlsx'

    FILL_OTHER = r'D:\learning_resources\2018new\中国与37个国家的虚拟变量及距离.xlsx'

    FILL_TARIFF = r'D:\learning_resources\2018new\37个国家15年对中国的关税数据（MFN和优惠税率）(2).xlsx'

    EUROPE_COUNTRIES = [
        'Belgium',
        'France',
        'Germany',
        'Italy',
        'Netherlands',
        'Spain',
        'Turkey',
        'United Kingdom'
    ]

    EUROPE_NAME = 'European Union'

    #####################################

    #####################################
    # 求和作业
    #####################################

    SUM_SOURCE_FILE = r'D:\learning_resources\2018new\import3.xlsx'
    # SUM_SOURCE_FILE = r'D:\learning_resources\2018new\test.xlsx'

    #####################################

    #####################################
    # 计算子分类 作业
    #####################################

    S_C_FEATURES_FILE = r'D:\learning_resources\text_analysis\machine_coding\features.xlsx'

    S_C_XML_PATH = r'D:\learning_resources\text_analysis\machine_coding\China_FTAs'

    S_C_COLUMN = 'Sub-category'

    #####################################

    #####################################
    # 提取 Excel 金额数额
    #####################################
    EXTRACT_NUMBERS_SRC_COLUMN_INDEX = 4

    EXTRACT_NUMBERS_FILENAME = '~/Documents/docs/learning/test_罚款金额提取.xlsx'

    DUPLICATE_LINE_FILENAME = '/Users/xiaogang/Documents/docs/learning/usntb3.xlsx'
